/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: LoggerService
 * Author:   zhouheng
 * Date:     2019/4/2 23:57
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.onesquare.user.service;

import com.alibaba.fastjson.JSON;
import com.onesquare.user.config.RabbitMqConfig;
import com.onesquare.user.pojo.SysLog;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author zhouheng
 * @create 2019/4/2
 * @since 1.0.0
 */

@Service
public class LoggerService {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void log(SysLog sysLog) {
        rabbitTemplate.convertAndSend("log-queue", JSON.toJSONString(sysLog));
    }
}